﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using doanqlhs.DATA;

namespace doanqlhs
{
    public partial class main : Form
    {
        public main()
        {
            InitializeComponent();

        }
        private void main_Load(object sender, EventArgs e)
        {
            groupBox1.Enabled = false;
            MessageBox.Show("Vui lòng đăng nhập để thực hiện chức năng nhập (ADMIN, 123456)");
            //Khởi tạo CSDL
            int kq = OleDB.InitOleDB();
            if (kq == -1)
            {
                MessageBox.Show("Không tìm thấy file dữ liệu");
                return;
            }
        }
        private void thoátToolStripMenuItem_Click(object sender, EventArgs e)
        {
            #region Thoát
            DialogResult ok;
            ok = MessageBox.Show("Bạn thực sự muốn thoát?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (ok == DialogResult.Yes)
            {
                this.Close();
                OleDB.close();
            }
            else
            {
                return;
            }
            #endregion
        }

        private void đăngNhậpToolStripMenuItem_Click(object sender, EventArgs e)
        {
            #region Login
            doanqlhs.DESIGN.Login frm = new doanqlhs.DESIGN.Login();
            if(frm.ShowDialog() == DialogResult.OK)
            {
                //Enable text
                groupBox1.Enabled = true;
            }
            #endregion
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            #region NhapHs
            doanqlhs.DESIGN.NhapHs frm = new doanqlhs.DESIGN.NhapHs();
            frm.Show();
            #endregion
        }

        private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            #region NhapKL
            doanqlhs.DESIGN.NhapKL frm = new doanqlhs.DESIGN.NhapKL();
            frm.Show();
            #endregion
        }

        private void linkLabel7_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            #region NhapLop
            doanqlhs.DESIGN.NhapLop frm = new doanqlhs.DESIGN.NhapLop();
            frm.Show();
            #endregion
        }

        private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            #region NhapMonHoc
            doanqlhs.DESIGN.NhapMH frm = new doanqlhs.DESIGN.NhapMH();
            frm.Show();
            #endregion
        }

        private void linkLabel6_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            #region NhapBangDiem
            doanqlhs.DESIGN.NhapBD frm = new doanqlhs.DESIGN.NhapBD();
            frm.Show();
            #endregion
        }
        private void linkTraCuuHS_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            #region TraCuuSV
            doanqlhs.DESIGN._Out.TraCuuBangDiemMonHoc frm = new doanqlhs.DESIGN._Out.TraCuuBangDiemMonHoc();
            frm.Show();
            #endregion
        }

        private void linkTraCuuLop_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            #region TraCuuLop
            doanqlhs.DESIGN._Out.TraCuuLop frm = new doanqlhs.DESIGN._Out.TraCuuLop();
            frm.Show();
            #endregion
        }
        private void linkLabel1_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e)
        {
            #region ThayDoiQuyDinh
            doanqlhs.DESIGN._change.QuyDinh frm = new doanqlhs.DESIGN._change.QuyDinh();
            frm.Show();
            #endregion
        }

        private void linkLabel2_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e)
        {
            #region ThayDoiThongTinLop
            doanqlhs.DESIGN._change.ThongTinLop frm = new doanqlhs.DESIGN._change.ThongTinLop();
            frm.Show();
            #endregion
        }
        private void linkLabel3_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e)
        {
            #region ThayDoiThongTinMonHoc
            doanqlhs.DESIGN._change.ThongTinMon frm = new doanqlhs.DESIGN._change.ThongTinMon();
            frm.Show();
            #endregion
        }
        private void main_FormClosed(object sender, FormClosedEventArgs e)
        {
            OleDB.close();
        }

        private void groupBox1_Enter(object sender, EventArgs e)
        {
         
        }

        private void groupBox3_Enter(object sender, EventArgs e)
        {

        }

        private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            #region LapDSSV
            doanqlhs.DESIGN._Out.LayDSSV frm = new doanqlhs.DESIGN._Out.LayDSSV();
            frm.Show();
            #endregion
        }

        private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }

        


       

        
    }
}
